//
//  MeatMineFooter.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/30.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatMineFooter.h"

@interface MeatMineFooter ()

@property (nonatomic, strong) UIView *contentView;

@property (nonatomic, strong) UILabel *moreLab;


@end


@implementation MeatMineFooter


#pragma mark - lifecycle methods

- (void)setupUI{
    
    self.backgroundColor = mBackgroudColor;
    self.height = 50;
    [self addSubview:self.contentView];
    
    [_contentView addSubview:self.moreLab];
    
}

- (void)setupLayout{
    
    {
        _contentView.size = CGSizeMake(KScreenWidth - 30, 50);
        _contentView.mj_x = 15;
        _contentView.mj_y = 0;
    }
    
    
    {
        _moreLab.mj_x = 0;
        _moreLab.size = CGSizeMake(KScreenWidth - 30, 50);
        _moreLab.mj_y = 0;
    }
    
    NSMutableAttributedString *aims = [@"更多 " createAttributingByIcon:nil downIndexImage:@"meat_mine_doublearrow" textColor:UIColorFromRGB(0xBBBBBB) font:mFont(14)];
    _moreLab.attributedText = aims;
    
}


#pragma mark - response methods
#pragma mark - public methods
#pragma mark - setter methods


#pragma mark - getter methods

- (UIView *)contentView{
    
    if (!_contentView) {
        _contentView = [[UIView alloc] init];
        _contentView.backgroundColor = KWhiteColor;
        [self drawCornerByView:_contentView];
    }
    return _contentView;
}


- (void)drawCornerByView:(UIView *)view{
    
    CGRect rect = CGRectMake(0, 0, KScreenWidth - 30, 50);
    UIRectCorner corners = UIRectCornerBottomLeft|UIRectCornerBottomRight;
    UIBezierPath *rounded = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:corners cornerRadii:CGSizeMake(8, 8)];
    CAShapeLayer *shape = [[CAShapeLayer alloc] init];
    [shape setPath:rounded.CGPath];
    view.layer.mask = shape;
}


- (UILabel *)moreLab{
    
    if (!_moreLab) {
        _moreLab = [UILabel makeLabelWithText:@"" textColor:UIColorFromRGB(0x333333) font:mFont(20) textAliment:0];
        _moreLab.textAlignment = NSTextAlignmentCenter;
    }
    return _moreLab;
}

@end
